package com.kangfu.api.controller;

import com.kangfu.api.service.IOperationGuideService;
import com.kangfu.common.annotation.IgnoreAuth;
import com.kangfu.common.model.AjaxResult;
import com.kangfu.db.domain.entity.OperationGuide;
import com.kangfu.db.model.vo.OperationGuideVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/guide")
public class OperationGuideController {

    @Autowired
    private IOperationGuideService operationGuideService;

    @GetMapping("/list")
    public AjaxResult list() {
        List<OperationGuideVo> list = operationGuideService.getList();
        return AjaxResult.success(list);
    }

    @GetMapping("/info")
    public AjaxResult info(@RequestParam(name = "id", defaultValue = "1") Integer id) {
        OperationGuide operationGuide = operationGuideService.info(id);
        return AjaxResult.success(operationGuide);
    }
}
